
let executor = function( resolve , reject ){
    resolve();
}

/*
let promise1 = new Promise( executor );

// 为 promise1 对象绑定 resolve 对应的处理函数
// then 函数执行后会返回一个新的 Promise 对象 ( promise2 )
let promise2 = promise1.then( function(){
    return 'A';
} );

// 为 p 对象绑定 resolve 对应的处理函数
let promise3 = promise2.then( param => {
    console.log( param );
    return 'B' ;
} );

promise3.then( param => console.log( param ) );
*/

let p = new Promise( executor );

p.then(function(){
    return 'A';
}).then( param => {
    console.log( param );
    return 'B' ;
}).then( param => console.log( param ) );